2. Getting Help
Windows PowerShell contains an extensive built-in help system, and you can access it quickly by typing help at the command-line interface. This is an alias for the cmdlet Get-Help. You can even get help about Get-Help by typing Get-Help Get-Help.
The output from such a command lists a description of the cmdlet, the
syntax used by the cmdlet, parameter descriptions, examples, and other
related notes. You also can use the Get-Help
cmdlet to get help with the basic Windows PowerShell language. For
example, you can use the following commands to get help about specific
topics: Get-Help foreach, or Get-Help substring, or Get-Help variables.
Note:
The best way to learn Windows
PowerShell is to use its built-in help system. If you or your
developers create new Windows PowerShell cmdlets, make sure you create
your own help files. In addition to the built-in help, there are many
resources on the Internet. For example, you can download a free Windows
PowerShell Help 2.0 for either 32-bit or 64-bit from http://www.primaltools.com/downloads/communitytools/.
2.1. Help Files
Get-Help finds the
information to display by using Extensible Markup Language (XML) files
that are installed on the server. When you installed SharePoint, help
files were installed along with the Windows PowerShell snap-in. These
files can be found in %CommonProgramFiles%\Microsoft Shared\Web Server
Extensions\14\CONFIG\PowerShell\Help or %CommonProgramFiles%\Microsoft
Shared\Web Server Extensions\14\CONFIG\PowerShell\Help\<locale>, where locale defines the language of the computer, such as en-us. These files use the naming convention <dll filename>-help.xml,
such as Microsoft.SharePoint.PowerShell.dll-help.xml,
Microsoft.SharePont.Search.dll-help.xml, and
Microsoft.Office.Access.Server.dll-help.xml. You can find which cmdlets
use which XML help file by typing
PS C:\Users\Peter>Get-Command -PSSnapin "Microsoft.SharePoint.PowerShell" |
>>sort helpfile, name |
>>Format-Wide name -column 2 -groupby helpfile | more
>><ENTER>
:
Get-SPExcelBlockedFileType Get-SPExcelDataProvider
Remove-SPExcelDataProvider Remove-SPExcelUserDefinedFunction
Set-SPExcelFileLocation
HelpFile: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions
\14\CONFIG\PowerShell\Help\microsoft.office.access.server.dll-help.xml
Get-SPAccessServiceApplication New-SPAccessServiceApplication
Set-SPAccessServiceApplication
HelpFile: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions
\14\CONFIG\PowerShell\Help\Microsoft.Office.Excel.Server.MossHost.dll-help.xml
Get-SPExcelDataConnectionLibrary Get-SPExcelFileLocation
Get-SPExcelServiceApplication Get-SPExcelUserDefinedFunction
New-SPExcelBlockedFileType New-SPExcelDataConnectionLibrary
New-SPExcelDataProvider New-SPExcelFileLocation
New-SPExcelServiceApplication New-SPExcelUserDefinedFunction
Remove-SPExcelBlockedFileType Remove-SPExcelDataConnectionL...
Remove-SPExcelFileLocation Set-SPExcelDataConnectionLibrary
Set-SPExcelDataProvider Set-SPExcelServiceApplication
-- More -
Note:
MORE INFO
You can find more information about the format of the cmdlet XML help
files and how to make your own help files to complement new cmdlets you
create at http://blogs.msdn.com/powershell/archive/2006/09/14/Draft-Creating-Cmdlet-Help.aspx and http://blogs.msdn.com/powershell/archive/2008/12/24/powershell-v2-external-maml-help.aspx.
2.2. ISE Help
In addition to the
command-line help function, there is a graphical help file
(WindowsPowerShellHelp.chm) located at %SystemRoot%\Help\mui\<LCID> where LCID
is the locale identifier or language of your installation, such as
0409. You can access the graphical help file when using the ISE by
selecting the command you want help for and then pressing F1. The chm file opens, and help is displayed for the command, as shown in Figure 3.
However, the chm file
contains help only for the core Windows PowerShell cmdlets. If you need
SharePoint-specific help, you should use the SharePoint 2010 Management
Shell and the Get-Help cmdlet.
Note:
MORE INFO
For more information on the Help feature in Windows PowerShell and how
you can configure it to show help for aliases or how to disable local
help and force ISE to get help directly from TechNet, see http://blogs.microsoft.co.il/blogs/scriptfanatic/archive/2009/01/31/using-help-in-powershell-ise.aspx.
Microsoft recommends that you always check the online help to find the
latest information and examples. The link to the online version can be
found in the Related Links section when you use the Get-Help command.